package com.mouse.magent.common.exception;

import lombok.Getter;

public class BaseException extends RuntimeException {
    @Getter
    private final ErrorType errorType;

    public BaseException() {
        this.errorType = SystemErrorType.SYSTEM_ERROR;
    }

    public BaseException(ErrorType errorType) {
        this.errorType = errorType;
    }

    public BaseException(ErrorType errorType, String message) {
        super(message);
        this.errorType = errorType;
    }

    public BaseException(ErrorType errorType, String message, Throwable cause) {
        super(message, cause);
        this.errorType = errorType;
    }

    public BaseException(String message) {
        super(message);
        SystemErrorType systemError = SystemErrorType.SYSTEM_ERROR;
        systemError.setMessage(message);
        this.errorType = systemError;
    }
}
